function [theta2_range, rho_rho_star, yy] = calculate_scattering(params)
    % 计算散射角度范围
    theta2_range = deg2rad(-80:0.001:80);
    
    % 计算基本参数
    K = (2 * pi) / params.lambda;
    vx = K * (sin(params.theta1) - sin(theta2_range));
    vz1 = -(2 * pi / params.lambda) * (cos(params.theta1) + cos(params.theta1));
    vz = -(2 * pi / params.lambda) * (cos(theta2_range) + cos(theta2_range));
    
    % 计算F因子
    F = sec(params.theta1) * (1 + cos(params.theta1 + theta2_range)) ./ ...
        (cos(params.theta1) + cos(theta2_range));
    
    % 计算g参数
    g = vz1^2 * params.sigma2^2;
    
    % 计算Q因子
    p = 10 * (sin(params.theta1) - sin(theta2_range));
    Q = (1 / (2 * pi)) * (sin(2 * params.n * p * pi) ./ ...
        (2 * params.n * sin(p * pi))) * sec(params.theta1) .* ...
        ((1 + cos(params.theta1 + theta2_range)) ./ ...
        (cos(params.theta1) + cos(theta2_range)));
    
    % 计算贝塞尔函数相关项
    s = ((2 * pi * params.A) / params.lambda) * ...
        (cos(params.theta1) + cos(theta2_range));
    
    % 向量化贝塞尔函数计算
    i_p1 = exp(1i * pi / 2 * mod(p, 4));
    i_p2 = exp(1i * pi / 2 * mod(-p, 4));
    Jp_s1 = besselj(p, -s);
    Jp_s2 = besselj(-p, s);
    
    integral1 = 2 * pi * i_p1 .* Jp_s1;
    integral2 = 2 * pi * i_p2 .* Jp_s2;
    
    % 计算无穷级数
    gm_sum = calculate_series(g, vx, vz, params);
    
    % 计算最终散射系数
    rho_rho_star = (Q.^2 .* exp(-g) .* (integral1 .* integral2)) + ...
        ((1.7724 * F.^2 .* params.T) / (2 .* params.L)) .* exp(-g) .* gm_sum;
    
    % 转换为对数形式
    yy = log10(rho_rho_star);
end 